import urllib
from urllib import request, parse
import ssl

context = ssl._create_unverified_context()
# url = "https://maicai.api.ddxq.mobi/homeApi/newDetails"
url = "https://maicai.api.ddxq.mobi/homeApi/newDetails?uid=59786872dc759e40ec5a5e68&longitude=121.425446&latitude=31.237419&station_id=6108f66781ff030001369967&city_number=0101&api_version=9.49.2&app_version=2.82.0&applet_source=&channel=applet&app_client_id=4&sharer_uid=&s_id=10fa0251c71abbd2bd914069b61d3074&openid=osP8I0WwHO78fDdWv6vaJWMVXZFg&h5_source=&device_token=WHJMrwNw1k%2FFKPjcOOgRd%2BJ1ee6rW3n%2FPRrH6Kq8m9g66TlQ%2BUvE66AmDe51vPg9Mc%2FXtPI0QeUz7MbJchBByraRk0jv7nINFdCW1tldyDzmauSxIJm5Txg%3D%3D1487582755342&preview_token=&nars=92e7b6876462eaef67126e0a62cf67ed&sesi=Zu3MFAm167fc7da512b15c61547a76eef97d9a5"
# url = "https://www.baidu.com"
headers = {
    "Cookie": "DDXQSESSID=10fa0251c71abbd2bd914069b61d3074",
    "Host": "maicai.api.ddxq.mobi",
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat",
    "content-type": "application/x-www-form-urlencoded",
    "ddmc-api-version": "9.49.2",
    "ddmc-app-client-id": "4",
    "ddmc-build-version": "2.82.0",
    "ddmc-channel": "applet",
    "ddmc-city-number": "0101",
    "ddmc-device-id": "osP8I0WwHO78fDdWv6vaJWMVXZFg",
    "ddmc-ip": "",
    "ddmc-latitude": "31.237419",
    "ddmc-longitude": "121.425446",
    "ddmc-os-version": "[object Undefined]",
    "ddmc-station-id": "6108f66781ff030001369967",
    "ddmc-uid": "59786872dc759e40ec5a5e68",
    "Referer": "https://servicewechat.com/wx1e113254eda17715/422/page-frame.html",
}
# headers = {}
req = urllib.request.Request(url=url, headers=headers)

resp = urllib.request.urlopen(req, context=context)
htmlDom = resp.read().decode('utf-8')
print(htmlDom)


